package com.shangcheng.model.vo;

import cn.hutool.core.bean.BeanUtil;
import com.shangcheng.model.domain.PmsProduct;
import com.shangcheng.model.domain.SmsFlashPromotionProductRelation;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class SmsFlashPromotionProductRelationVo implements Serializable {

    private Integer id;
    private Integer flashPromotionId;
    private Integer flashPromotionSessionId;
    private Integer productId;
    private BigDecimal flashPromotionPrice;
    private int flashPromotionCount;
    private int flashPromotionLimit;
    private int sort;
    private PmsProduct product;

    //进行对象的封装
    public static SmsFlashPromotionProductRelationVo init(SmsFlashPromotionProductRelation smsFlashPromotionProductRelation
            , PmsProduct product) {
        SmsFlashPromotionProductRelationVo vo = new SmsFlashPromotionProductRelationVo();
        BeanUtil.copyProperties(smsFlashPromotionProductRelation, vo);
        vo.setProduct(product);
        return vo;
    }
}
